﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>未入账收款记录</title>
    <script src="/js/header.js"></script>
    <script src="/lib/date/wdatepicker.js"></script>
</head>
<body>
    <div class="data-wrap case">
        <div class="data-tool clearfix">
            <div class="pull-left form-inline ">
            </div>
            <div class="pull-right">
                <form class="form-inline" id="formSearch">
                    <div class="input-group input-group-sm">
                        <label class="input-group-addon m5_l gettext">公司名称：</label>
                        <input class="form-control" name="companyName" type="text" autocomplete="off">
                    </div>

                    <div class="input-group input-group-sm">
                        <label class="input-group-addon m5_l gettext">收款卡用户名：</label>
                        <input class="form-control" name="cardName" type="text" autocomplete="off"/>
                    </div>

                    <div class="input-group input-group-sm">
                        <label class="input-group-addon m5_l gettext">收款金额(区间)：</label>
                        <input class="form-control wd75" name="startAmount" type="text" autocomplete="off" onkeyup="checknum(this);" maxlength="6" placeholder="起" />
                        <input class="form-control wd75" name="endAmount" type="text" autocomplete="off" onkeyup="checknum(this);" maxlength="6" placeholder="迄" />
                    </div>
                    <div class="input-group input-group-sm">
                        <label class="input-group-addon m5_l gettext">客户姓名：</label>
                        <input class="form-control" name="clientAccountName" type="text" autocomplete="off"/>
                    </div>

                    <div class="input-group input-group-sm">
                        <label class="input-group-addon m5_l gettext">收款时间：</label>
                        <input id="d421" class="Wdate wd125" name="startTime" type="text" onfocus="WdatePicker({maxDate:'%y-%M-%d'})" autocomplete="off" />
                        --<input id="d422" class="Wdate wd125 m5_l" name="endTime" type="text" onfocus="WdatePicker({minDate:'#F{$dp.$D(\'d421\')}'})" autocomplete="off" />
                    </div>
                    <button type="button" class="btn btn-default btn-sm active gettext" id="btnSearch">搜索</button>
                </form>
            </div>
        </div>
        <div class="paging">
        </div>
    </div>

    <script type="text/x-dot-template" id="pgerTemplate">
        <div class="data-body data-scroll">
            <div class="data-view">
                <div class="data-div-view  table-responsive">
                    <table class="table table-hover table-striped table-bordered">
                        <thead>
                            <tr>
                                <th class="t_l wd175">订单号</th>
                                <th class="t_l wd200">实际订单号</th>
                                <th class="t_l wd100">公司名称</th>
                                <th class="t_l wd100">银行名称</th>
                                <th class="t_l wd100">收款卡用户名</th>
                                <th class="t_l wd150">银行卡号</th>
                                <th class="t_r wd75">余额</th>
                                <th class="t_r wd75">收款金额</th>
                                <th class="wd150">收款时间</th>
                                <th class="t_l wd200">客户银行</th>
                                <th class="t_l wd75">客户姓名</th>
                                <th class="t_l wd150">客户卡号</th>
                                <th class="wd150">匹配单号</th>
                                <th class="t_l wd200">备注</th>
                                <th class="wd250">机器ID</th>
                            </tr>
                        </thead>
                        <tbody>
                            {{? it.tData && it.tData.length>0}}
                            {{~it.tData :item:index}}
                            <tr>
                                <td class="t_l wd175">{{= item.orderNo }}</td>
                                <td class="t_l wd200" title="{{= item.clientOrderNo }}">{{?  item.clientOrderNo}}{{= item.clientOrderNo }}{{??}}{{?}}</td>
                                <td class="t_l wd100" title="{{= item.companyNameEn }}">{{= item.companyName }}</td>
                                <td class="t_l wd100" title="{{= item.bankName }}">{{= item.bankName }}</td>
                                <td class="t_l wd100" title="{{= item.cardName }}">{{= item.cardName }}</td>
                                <td class="t_l wd150">{{= FlashPay.Util.SubCardNumber(item.cardNumber) }}</td>
                                <td class="t_r bold wd75">{{= item.afterBalance }}</td>
                                <td class="t_r bold wd75">{{= item.amount }}</td>
                                <td class="wd150">{{= item.operatingDate.replace("T"," ") }}</td>
                                <td class="t_l wd200">{{= item.clientBankName }}</td>
                                <td class="t_l wd75" title="{{= item.clientAccountName }}">{{= item.clientAccountName }}</td>
                                <td class="t_l wd150">{{= FlashPay.Util.SubCardNumber(item.clientCardNumber) }}</td>
                                <td class="wd150" title="{{= item.matchOrderNo }}">
                                    {{? FlashPay.Util.isNullOrEmptySpance(item.matchOrderNo) }}
                                    <a class="btn btn-default btn-xs btn-danger " data-title='{{= item.orderNo }}-补单' data-modal="/view/receipt/receiptmakeup.html?orderNo={{= item.orderNo}}" data-width="500" data-height="700">补单</a>
                                    {{??}}
                                    {{= item.matchOrderNo }}
                                    {{?}}
                                </td>
                                <td class="t_l wd200">{{?  item.remark}}{{= item.remark }}{{??}}{{?}}</td>
                                <td class="wd250" title="{{= item.vmClientID }}">{{= item.vmClientID }}</td>
                            </tr>
                            {{~}}
                            {{??}}
                            <tr class="noRecord">
                                <td colspan="14">暂无记录！</td>
                            </tr>
                            {{?}}
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
        <!-- 必要的分页参数设置 -->
        <input type="hidden" id="TotalCount" value="{{=it.totalCount}}" />
    </script>
    <script type="text/javascript">
        $(function () {
            FlashPay.UI.DataAutoHeight();

            setTime();
            $("#btnSearch").click(function () {
                FlashPay.UI.DoSearch();
            });

            FlashPay.UI.DoSearch();


            FlashPay.Util.Language();
        });

        $(document).keyup(function (event) {
            var keycode = event.which;
            if (keycode == 13) {
                FlashPay.UI.DoSearch();
            }
        });

        function Tip_success(word) {
            FlashPay.UI.Tip_success(word);
        }

        function doSearch() {
            FlashPay.UI.Pager(".paging", { templateId: "pgerTemplate", pageSize: 15, ajax: { url: "/Payment/ReceiptList"} });
        }

        function setTime() {
            let startTime = FlashPay.Util.GetDateStr(-1);
            $("input[name='startTime']").val(startTime);
            let endTime = FlashPay.Util.GetDateStr(0);
            $("input[name='endTime']").val(endTime);
        }

        function checknum(obj) {
            if (/^\d+\.?\d{0,2}$/.test(obj.value)) {
                obj.value = obj.value;
            } else {
                obj.value = obj.value.substring(0, obj.value.length - 1);
            }
        }
    </script>
</body>
</html>